package com.zlp.stack;

import java.util.ArrayList;
import java.util.List;

/**
 * 演示使用jvirsalvm查看对象个数
 *
 */
public class HeapDemo_2 {
    public static void main(String[] args) throws InterruptedException {
        /*List<Student> students = new ArrayList<>();
        for (int i=0;i<200;i++){
            students.add(new Student());
        }
        Thread.sleep(2000000000);*/
        detectCapitalUse("JGJHGJH");
    }


    public static boolean detectCapitalUse(String word) {
        boolean isLow = Character.isLowerCase(word.charAt(0))?true:false;
        for (int i=1;i<word.length();i++){
            if(isLow&&Character.isUpperCase(word.charAt(i))){
                return false;
            }
            if(i<word.length()-1 && (Character.isUpperCase(word.charAt(i))
                    !=Character.isUpperCase(word.charAt(i+1)))){
                return false;
            }
        }
        return true;
    }
}
class Student{
    private byte[] big = new byte[1024 * 1024];
}